﻿<!DOCTYPE html>
<html>
    <head>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>    
        <meta name="robots" content="index, follow" />
		<meta name="description" content="" />
        <meta name="keywords" content="" />        
        <meta charset="UTF-8">
        <meta http-equiv="Cache-Control" content="no-store" />
		<base href="<?php echo app()->getBaseUrl(true)?>"></base>
        <?php $themeUrl = Yii::app()->theme->baseUrl; ?>    
        <link rel="shortcut icon" type="image/png" id="favicon" href="<?php echo $themeUrl; ?>/images/favicon.ico"/>
        <link type="text/css" href="<?php echo $themeUrl; ?>/css/core.css" rel="stylesheet" media="all" />
        <link type="text/css" href="<?php echo $themeUrl; ?>/css/main.css" rel="stylesheet" media="all" />
        <link type="text/css" href="<?php echo $themeUrl; ?>/css/animation.css" rel="stylesheet" media="screen" />
        <link type="text/css" href="<?php echo $themeUrl; ?>/css/tooltip.css" rel="stylesheet" media="all" />
        
        <!--[if IE]>
            <link type="text/css" href="<?php echo $themeUrl; ?>/css/fixie.css" rel="stylesheet" />
        <![endif]-->    
        <!--[if IE 7]>
            <link type="text/css" href="<?php echo $themeUrl; ?>/css/fixie7.css" rel="stylesheet" />
        <![endif]-->
        
        <script type="text/javascript" src="<?php echo $themeUrl; ?>/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo $themeUrl; ?>/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
                
        <?php
        //cs()->registerScriptFile($themeUrl . '/js/jquery-1.7.2.min.js');
        cs()->registerScriptFile($themeUrl . '/js/LGCMS.js');
        cs()->registerScriptFile($themeUrl . '/js/common.js');
        cs()->registerScriptFile($themeUrl . '/js/jquery.cookie.js');
        cs()->registerScriptFile($themeUrl . '/js/tooltip.js');
        cs()->registerScriptFile($themeUrl . '/js/jquery.tooltip.js');	
        ?>
    </head>
    <body>     
        <div id="wrapper">
            <div id="container">
                <div id="header">
                    <div id="topline">
                        <div class="container">
                            <div class="logo fadeInLeft animated"></div>
                            <div class="top-info">
                                <?php $this->renderPartial("/layouts/_logon"); ?>
                            </div>
                        </div>                    
                    </div>
                    <?php    
                    $user = Yii::app()->user;
                    //$sbody = ' style="padding-top:50px;"';
                    $sbody = '';
                    /*if ($user->id):
                        $uModel = User::model()->findByPk($user->id);
                        if (!$uModel->isSubmitter()):
                            $sbody = '';*/
                    ?>
                    <div id="topbar">
                        <div class="container">
                            <div class="mainmenu">
                                <?php
                                    $systemMenu = new SystemMenu();
                                    $this->widget('zii.widgets.CMenu', array(
                                        'items' => $systemMenu->getMenusByUser(user()->id),
                                        'activateParents' => true,
                                        'activateItems' => true
                                    ));
                                    unset($systemMenu)
                                ?>
                            </div>
                            <div class="topbar-right"></div>                        
                        </div>
                        <div id="topbar-alert"></div>
                    </div>
                    <?php //endif; ?>
                    <?php //endif; ?>
                </div>
                <div id="body" class="container"<?php echo $sbody; unset($sbody); ?>>
                    <div id="content">
                        <?php
                        //$this->widget('LGBreadcrumbs', array('links' => $this->breadcrumbs,
                            //'homeLink' => CHtml::link(t('PAGE_TITLE', 'dashboard'), array('/dashboard/index'))
                        //));
                        ?>
                        <div id="scrollsection">
                        <div id="titlebar" class="titlebar">                        
                            <div class="bar-control"><?php echo $this->pageToolbar ?></div>
                            <h1><?php echo $this->pageHeader ?></h1>
                        </div>
                        </div>
                        <div class="main-content">                        
                            <?php
                            $flashMessages = Yii::app()->user->getFlashes();
                            if ($flashMessages) {
                                echo '<div id="system-message">';
                                foreach ($flashMessages as $key => $message) {
                                    echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
                                }
                                echo '</div>';
                            }
                            ?>
                            <div id="system-message" style="display: none;"><div id="message"></div></div>
                            <?php echo $content; ?>                        
                            <?php $this->widget('ext.EUpdateDialog.EUpdateDialog', array('dialogOptions' => array('resizable' => false))); ?>                                                
                        </div>                    
                    </div>                
                </div>
                <div id="footer">
                    <div class="container">
                        <span><?php echo t('LBL_COPYRIGHT'); ?> <?php echo date("Y"); ?> <?php echo t('LBL_FOOTER'); ?></span> | <span><b><?php echo t('LBL_VERSION'); ?></b> <?php echo Yii::app()->params['version']; ?></span> 
                    </div>
                </div>
            </div>
        </div>
        <div id="shareit-box"><img alt="" src="<?php echo $themeUrl . '/images/frame/ajax-loader.gif'; ?>"/></div>
    </body>
    <script>
            jQuery("body").ajaxComplete(
                function(event, request, options) {
                    if(LGCMS.isJsonString(request.responseText)){
                        var data = jQuery.parseJSON(request.responseText);
                        if (data != null && data.hasOwnProperty("expired")){
                            window.location = data.expired;
                        }
                    }
                }
            );        
    </script>
</html>

